﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Open.Data.Persistence
{
    public class NullComparison : Condition
    {
        public NullComparison(Expression expression): base()
        {
            if (expression == null) throw new ArgumentNullException();
            Expression = expression;
        }
        public Expression Expression { get; set; }

        public override IEnumerable<Expression> GetExpressions()
        {
            yield return Expression;
        }

        public override void AppendHashCode(StringBuilder builder)
        {
            Expression.AppendHashCode(builder);
            builder.Append(typeof(NullComparison).FullName);
        }
    }
}
